cmake_minimum_required(VERSION 3.12)
project(jtt808_evpp)

set(CMAKE_CXX_STANDARD 17)
add_executable(jtt808_server server.cpp
        jtt808_server.cpp
        codec/data_utils.cpp
        )
add_executable(jtt808_client client.cpp
        codec/data_utils.cpp
        )

set(MY_ROOT ~/pkg)
set(BOOST_ROOT ~/pkg)
find_package( Threads )
find_package(Boost 1.67.0 REQUIRED COMPONENTS thread system)
find_path(LIBGLOG_INCLUDE_DIR glog/logging.h)
find_path(LIBEVPP_INCLUDE_DIR evpp/sockets.h HINTS ${MY_ROOT})

find_library(LIBGLOG_LIBRARY glog)
find_library(EVPP_LIBRARY NAMES evpp HINTS "${MY_ROOT}/lib")

include_directories(${LIBGLOG_INCLUDE_DIR} "${MY_ROOT}/include")
target_link_libraries(jtt808_server PUBLIC ${Boost_LIBRARIES} ${EVPP_LIBRARY} ${LIBGLOG_LIBRARY} ${CMAKE_THREAD_LIBS_INIT})
target_link_libraries(jtt808_client PUBLIC ${EVPP_LIBRARY} ${LIBGLOG_LIBRARY} ${CMAKE_THREAD_LIBS_INIT})